<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('s_users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('openid',100)->unique()->comment('微信唯一标识');
            $table->string('nickname',50)->nullable()->comment('用户昵称');
            $table->string('avatar',100)->nullable()->comment('头像');
            $table->tinyInteger('gender')->nullable()->comment('性别：1：男  2：女');
            $table->string('country',100)->nullable()->comment('国家');
            $table->string('province',100)->nullable()->comment('省份');
            $table->string('city',100)->nullable()->comment('城市');
            $table->string('phone',20)->nullable()->comment('手机号码');
            $table->string('session_key',255)->nullable()->comment('微信端密钥');
            $table->bigInteger('merchant_id')->default(-1)->comment('商户 -1：没有商户');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('s_users');
    }
}
